@Function@<+!><:f200,2Times New Roman,0,0,0><:ZOpenAutoExec1>FUNCTION OpenAutoExec()<:ZOpenAutoExec11><-!>
<:f200,2Times New Roman,>' SingleStep(1)<:f>
<:f200,2Times New Roman,0,0,0>defstr fid;
<:f200,2Times New Roman,0,0,0><:ZMACUTEMP1><:ZOpenAutoExec12>auto = FindAutoExec(); ' Find<:f200,2Times New Roman,0,0,0> the autoexec script
<:f200,2Times New Roman,0,0,0>If (0 = Assign(&fid, fopen(auto, "r"))) ' Does it exist?
<:f200,2Times New Roman,0,0,0> sty = GetProfileString$("AmiPro", "defstyle", "amipro.ini")
<:f200,2Times New Roman,0,0,0> If sty = ""
<:f200,2Times New Roman,0,0,0> sty = "_default.sty"
<:f200,2Times New Roman,0,0,0> Endif
<:f200,2Times New Roman,0,0,0> new(sty, 0, 0) ' No let ami create it.
<:f200,2Times New Roman,0,0,0> type("FUNCTION auto()<[>enter]") ' And fill in an empty
<:f200,2Times New Roman,0,0,0> type("END FUNCTION<[>enter]") ' Function - End Function Pait
<:f200,2Times New Roman,0,0,0> type("<[>ctrlhome]") ' Position at top of file
<:f200,2Times New Roman,0,0,0> saveas(auto, 32,"", "") ' Create it.
<:f200,2Times New Roman,0,0,0>Else
<:f200,2Times New Roman,0,0,0> fclose(fid) ' it existed. so close this
<:f200,2Times New Roman,0,0,0> FileOpen(auto, 1, "") <:f><:f200,2Times New Roman,0,0,0>'<:f><:f200,2Times New Roman,0,0,0> let ami open
<:f200,2Times New Roman,0,0,0>Endif
<:f200,,>
<:f200,,>retcode$ = Replace(0, 0, 0, "winfax.smm", "") <:f><:f200,2Times New Roman,0,0,0>'<:f><:f200,,> Look for existing WinFax macro
<:f200,,>If retcode$ = 1
<:f200,,> Message("An existing WinFax macro has been found")<:f><:f200,,> <:f><:f200,2Times New Roman,>' Found an existing WinFax macro<:f200,,>
<:f200,,>Else
<:f200,2Times New Roman,0,0,0> Replace(0, 0, 24576, "End function", "") ' position at first end function
<:f200,2Times New Roman,0,0,0> type("<[>home]") ' before the End
<:f200,2Times New Roman,0,0,0> type("<[>enter]") ' create a line
<:f200,2Times New Roman,0,0,0> type("<[>up]") ' position on that line
<:f200,2Times New Roman,0,0,0> AddWinFax()<:f>
<:f200,,>EndIf<:f>
<:f200,2Times New Roman,0,0,0>
@Function@<:f200,2Times New Roman,0,0,0><+!>END FUNCTION<-!>
@Function@<:f200,2Times New Roman,0,0,0>
@Function@<:f200,2Times New Roman,0,0,0><+!><:ZFindAutoExec><:ZFindAutoExec1>FUNCTION FindAutoExec()<-!><:ZOpenAutoExec13><:Z~FindAutoExec>
<:f200,2Times New Roman,0,0,0>'
<:f200,2Times New Roman,0,0,0>' FindAutoExec - determine where the autoexec.smm file is. If we can find it in the macro
<:f200,2Times New Roman,0,0,0>' directory or the docs directory, return the amipro directory.
<:f200,2Times New Roman,0,0,0>'<:f>
<:f200,2Times New Roman,0,0,0>defstr fid;
<:f200,2Times New Roman,0,0,0>auto = strcat$(GetMacPath$(), "autoexec.smm") ' check macro dir first
<:f200,2Times New Roman,0,0,0>If (0 = Assign(&fid, fopen(auto, "r"))) ' Does it exist?
<:f200,2Times New Roman,0,0,0> auto = strcat$(GetDocPath$(), "autoexec.smm") ' Now the docs dir
<:f200,2Times New Roman,0,0,0> If (0 = Assign(&fid, fopen(auto, "r"))) ' Does it exist?
<:f200,2Times New Roman,0,0,0> auto = strcat$(GetAmiDirectory$(), "autoexec.smm") ' lastly amipro dir
<:f200,2Times New Roman,0,0,0> Else
<:f200,2Times New Roman,0,0,0> fclose(fid)
<:f200,2Times New Roman,0,0,0> Endif
<:f200,2Times New Roman,0,0,0>Else
<:f200,2Times New Roman,0,0,0> fclose(fid)
<:f200,2Times New Roman,0,0,0>Endif
<:f200,2Times New Roman,0,0,0>return auto
@Function@<:f200,2Times New Roman,0,0,0><+!>END FUNCTION<-!>
<:f200,2Times New Roman,0,0,0>
@Function@<:f200,2Times New Roman,0,0,0><+!><:ZAddWinFax>FUNCTION AddWinFax()<-!><:Z~AddWinFax>
<:f200,2Times New Roman,>DeleteMenuItem(1,"&File","&WinFax") 'Remove the menu if it already exists.
<:f200,2Times New Roman,>DeleteMenuItem(1,"&File","&WinFax...") 'Remove the menu if it already exists.
<:f200,2Times New Roman,>
<:f200,2Times New Roman,>macpath = GetProfileString$("AmiPro", "macrodir", "AMIPRO.INI")<:f>
<:f200,2Times New Roman,>icon<:f><:f200,2Times New Roman,>path = GetProfileString$("AmiPro", "icon<:f><:f200,2Times New Roman,>path", "AMIPRO.INI")
<:f200,2Times New Roman,><:f><:f200,2Times New Roman,><:f200,2Times New Roman,>style<:f><:f200,2Times New Roman,><:f><:f200,2Times New Roman,>path = GetProfileString$("AmiPro", "sty<:f><:f200,2Times New Roman,><:f><:f200,2Times New Roman,>path", "AMIPRO.INI
")<:f><:f200,2Times New Roman,>
<:f200,2Times New Roman,><:f><:f200,2Times New Roman,>wfxmacpath<:f><:f200,2Times New Roman,> = Strcat$(GetProfileString$("WinFax", "ExePath"),"macros")<:f>
<:f200,2Times New Roman,>
<:f200,2Times New Roman,>' Copy macros from the WinFax macro directory.
<:f200,2Times New Roman,>DOSCopyFile(<:f><:f200,2Times New Roman,>Strcat$(<:f><:f200,2Times New Roman,>wfxmacpath<:f><:f200,2Times New Roman,>,<:f><:f200,2Times New Roman,>"\faxmerge.smm"<:f><:f200,2Times New Roman,>),<:f><:f200,2Times New Roman,>Strcat$(<:f>
<:f200,2Times New Roman,>macpath,<:f><:f200,2Times New Roman,>"\faxmerge.smm"<:f><:f200,2Times New Roman,>))
<:f200,2Times New Roman,><:f><:f200,2Times New Roman,><:f200,2Times New Roman,>DOSCopyFile(<:f><:f200,2Times New Roman,>Strcat$(<:f><:f200,2Times New Roman,>wfxmacpath<:f><:f200,2Times New Roman,>,<:f><:f200,2Times New Roman,>"\_winfax4<:f><:f200,2Times New Roman,>
.sty<:f><:f200,2Times New Roman,>"<:f><:f200,2Times New Roman,>),<:f><:f200,2Times New Roman,>Strcat$(<:f><:f200,2Times New Roman,>style<:f><:f200,2Times New Roman,>path,<:f><:f200,2Times New Roman,>"\<:f><:f200,2Times New Roman,>_winfax4<:f><:f200,2Times New Roman,>
.sty<:f><:f200,2Times New Roman,><:f><:f200,2Times New Roman,>"<:f><:f200,2Times New Roman,>))<:f><:f200,2Times New Roman,>
<:f200,2Times New Roman,>DOSCopyFile(<:f><:f200,2Times New Roman,>Strcat$(<:f><:f200,2Times New Roman,>wfxmacpath<:f><:f200,2Times New Roman,>,<:f><:f200,2Times New Roman,>"\prn2wnfx<:f><:f200,2Times New Roman,>.smm"<:f><:f200,2Times New Roman,>)<:f><:f200,2Times New Roman,>
,<:f><:f200,2Times New Roman,>Strcat$(<:f><:f200,2Times New Roman,>macpath<:f><:f200,2Times New Roman,>"\prn2wnfx<:f><:f200,2Times New Roman,>.smm"<:f><:f200,2Times New Roman,>)<:f><:f200,2Times New Roman,>)
<:f200,2Times New Roman,>DOSCopyFile(<:f><:f200,2Times New Roman,>Strcat$(<:f><:f200,2Times New Roman,>wfxmacpath<:f><:f200,2Times New Roman,>,"\prn2wnfx.bmp"<:f><:f200,2Times New Roman,>)<:f><:f200,2Times New Roman,>,<:f><:f200,2Times New Roman,>Strcat$(<:f>
<:f200,2Times New Roman,>icon<:f><:f200,2Times New Roman,>path<:f><:f200,2Times New Roman,>,"\prn2wnfx.bmp"<:f><:f200,2Times New Roman,>)<:f><:f200,2Times New Roman,>)
<:f200,2Times New Roman,>
<:f200,2Times New Roman,>Type ( "' Delrina WinFax PRO macro begins ===============<[>Enter]" )
<:f200,2Times New Roman,>Type ( "'<[>Enter]" )
<:f200,2Times New Roman,>Type ( "' Copies custom macros to the macros directory, and<[>Enter]" )
<:f200,2Times New Roman,>Type ( "' adds WinFax to the File menu.<[>Enter]" )
<:f200,2Times New Roman,>Type ( "DeleteMenuItem(1,""&File"",""&WinFax"") 'Remove the menuitem if it already exists.<:f200,2Times New Roman,0,0,0><[>Enter]" )
<:f200,2Times New Roman,>Type ( "DeleteMenuItem(1,""&File"",""&WinFax..."") 'Remove the menuitem if it already exists.<:f200,2Times New Roman,0,0,0><[>Enter]" )
<:f200,2Times New Roman,0,0,0>Type( "menuname = ""&File<:f200,2Times New Roman,0,0,0>""<[>Enter]" )
<:f200,2Times New Roman,0,0,0>Type( "itemname = ""&WinFax...""<[>Enter]" )
<:f200,2Times New Roman,0,0,0>Type( "macroname = ""prn2<:f200,2Times New Roman,0,0,0>wnfx.smm""<[>Enter]" )
<:f200,2Times New Roman,0,0,0>Type( "helptext = ""Print current document to Delrina WinFax<:f200,2Times New Roman,0,0,0>."<:f200,2Times New Roman,0,0,0>"<[>Enter]"<:f200,2Times New Roman,0,0,0> )
<:f200,2Times New Roman,0,0,0>Type( "pos = 16<:f200,2Times New Roman,0,0,0><[>Enter]")
<:f200,2Times New Roman,0,0,0>Type( "InsertMenuItem(1, {{menuname}, {{pos},{{itemname}, {{macroname}, {{helptext})<:f200,2Times New Roman,0,0,0><[>Enter]"<:f200,2Times New Roman,0,0,0> )
<:f200,2Times New Roman,>Type ( "'<[>Enter]" )
<:f200,2Times New Roman,>Type ( "' Delrina WinFax PRO macro ends =================" )
<:f200,2Times New Roman,0,0,0>Save( )
<:f200,2Times New Roman,0,0,0>FileClose( )
<:f200,2Times New Roman,>InsertMenuItem(1, "&File", "16", "&WinFax...",
<:f200,2Times New Roman,0,0,0>"<:f200,2Times New Roman,0,0,0>prn2wnfx.smm"<:f200,2Times New Roman,>,
<:f200,2Times New Roman,0,0,0>"Print current document to Delrina WinFax."<:f200,2Times New Roman,>)<:f>
@Function@<-!><:f200,2Times New Roman,0,0,0><+!>END FUNCTION<-!><:f>
>
[Embedded]
00011385
>
[macsum] 3
OpenAutoExec 0 0 5 14
FindAutoExec 591 0 3 46
AddWinFax 945 0 5 66
[macse]
14 OpenAutoExec
16 FindAutoExec
13
8 2
5 0
0 259 "{2}" "r"
13
0 805 &1 [X]
13
18 0
11 00000330
0 286 "AmiPro" "defstyle" "amipro.ini"
13
8 3
6 3
7 ""
18 0
11 00000208
7 "_default.sty"
8 3
2 101 1 "{3}" 0 0
0 6 "FUNCTION auto()[13]"
0 6 "END FUNCTION[13]"
0 6 "[16420]"
2 104 1 "{2}" 32 "" ""
10 00000363
0 260 "{1}"
2 102 1 "{2}" 1 ""
2 488 1 0 0 0 "winfax.smm" ""
13
8 4
6 4
5 1
18 0
11 00000492
0 3 "An existing WinFax macro has been found"
10 00000579
2 488 1 0 0 24576 "End function" ""
0 6 "[36]"
0 6 "[13]"
0 6 "[38]"
16 AddWinFax
6 0
15
9
14 FindAutoExec
0 295
13
0 16 [X] "autoexec.smm"
13
8 2
5 0
0 259 "{2}" "r"
13
0 805 &1 [X]
13
18 0
11 00000317
0 268
13
0 16 [X] "autoexec.smm"
13
8 2
5 0
0 259 "{2}" "r"
13
0 805 &1 [X]
13
18 0
11 00000291
0 798
13
0 16 [X] "autoexec.smm"
13
8 2
10 00000304
0 260 "{1}"
10 00000330
0 260 "{1}"
6 2
15
9
6 0
15
9
14 AddWinFax
0 520 1 "&File" "&WinFax"
0 520 1 "&File" "&WinFax..."
0 286 "AmiPro" "macrodir" "AMIPRO.INI"
13
8 1
0 286 "AmiPro" "iconpath" "AMIPRO.INI"
13
8 2
0 286 "AmiPro" "stypath" "AMIPRO.INI"
13
8 3
0 286 "WinFax" "ExePath"
13
0 16 [X] "macros"
13
8 4
0 16 "{4}" "\faxmerge.smm"
13
0 16 "{1}" "\faxmerge.smm"
13
0 803 [X] [X]
0 16 "{4}" "\_winfax4.sty"
13
0 16 "{3}" "\_winfax4.sty"
13
0 803 [X] [X]
0 16 "{4}" "\prn2wnfx.smm"
13
0 16 "{1}" "\prn2wnfx.smm"
13
0 803 [X] [X]
0 16 "{4}" "\prn2wnfx.bmp"
13
0 16 "{2}" "\prn2wnfx.bmp"
13
0 803 [X] [X]
0 6 "' Delrina WinFax PRO macro begins ===============[13]"
0 6 "'[13]"
0 6 "' Copies custom macros to the macros directory, and[13]"
0 6 "' adds WinFax to the File menu.[13]"
0 6 "DeleteMenuItem(1,""&File"",""&WinFax"") 'Remove the menuitem if it already exists.[13]"
0 6 "DeleteMenuItem(1,""&File"",""&WinFax..."") 'Remove the menuitem if it already exists.[13]"
0 6 "menuname = ""&File""[13]"
0 6 "itemname = ""&WinFax...""[13]"
0 6 "macroname = ""prn2wnfx.smm""[13]"
0 6 "helptext = ""Print current document to Delrina WinFax.""[13]"